home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
art&graf.ix
/
art-3139
/
boot_pic.mug
/
tn1_prog.s
< prev
Wrap
Text File
|
1987-04-21
|
5KB
|
201 lines
;
; Tiny '.TN1' Picture & Program Booter v1.0 !!
; --------------------------------------------
;
; Coded by: Mike Mee (but credit MUG U.K if ya use it Bruce !!)
;
; v1.0 - Adapted from Degas Picture & Program Booter v1.0
;
;
; Use Low res Tiny pictures only and alter the appropriate line for
; pictures' length !!
;
; Best used on a disk where all programs 'AUTO' load from the menu
; and not from desktop - as GEM will never be resident !!
;
; 1 cluster saved due to no AUTO folder & stacks saved on a well
; compressed TINY picture !!
;
; No idea if this works on an 512K ST/512K or 1040K STE !!
; Although no illegal routines are employed - so it should work OK !!
;
yes equ 1
no equ 0
text_on equ no ; if no = saves 12 bytes + length of text !!
pic_adr equ $20000
buffer equ $27d00
opt p+,o+,d-,s-
bra.s start
dc.b "Coded by: MUG U.K",191," - 16/10/1991",0
start
ifne text_on
pea text(pc)
move.w #9,-(a7)
trap #1
addq.w #6,a7
endc
lea filename(pc),a0 ; file to load
move.l #pic_adr-34,d6 ; destination address
move.l #3410,d7 ; length = ????? bytes
loadit lea handle(pc),a6
clr.w -(a7) ; mode = 0 (open to read)
move.l a0,-(a7) ; filename to open
move.w #$3d,-(a7) ; f_open
trap #1 ; do it !!
addq.l #8,a7 ; tidy stack
move.w d0,(a6) ; store file handle returned
move.l d6,-(a7) ; address to load to
move.l d7,-(a7) ; amount to read in
move.w d0,-(a7) ; file handle
move.w #$3f,-(a7) ; f_read
trap #1 ; do it
adda.l #$c,a7 ; tidy stack
move.w (a6),-(a7) ; file handle
move.w #$3e,-(a7) ; f_close
trap #1 ; do it !!
addq.l #4,a7 ; tidy stack
lea pic_adr-34,a0
lea buffer,a1
; Source for unpacking Tiny-pictures - Written by Axe of Delight
; Assemble with Devpac 2.08, Tab-position: 10
; You need source (packed tiny screen) and destination (screen address)
; for unpacking. After unpacking, the palette is saved at 'tinpal'.
tiny: movem.l d1-d6/a2-a5,-(sp)
bsr t_getpal ; read resolution and palette
move.l a4,d5
move.l a1,d6
add.l #$7d00,d6
move.l a1,d4
add.l #$a0,d4
bra.s t17a0a
t179be: moveq #0,d0
move.b (a5)+,d0
beq.s t179ce
cmp.b #1,d0
beq.s t179d6
ext.w d0
bra.s t179de
t179ce: move.b (a5)+,d0
lsl.w #8,d0
move.b (a5)+,d0
bra.s t179de
t179d6: move.b (a5)+,d0
lsl.w #8,d0
move.b (a5)+,d0
neg.w d0
t179de: tst.w d0
bmi.s t179ea
move.b (a4)+,d3
lsl.w #8,d3
move.b (a4)+,d3
bra.s t17a2e
t179ea: neg.w d0
bra.s t17a06
t179ee: move.b (a4)+,(a1)+
move.b (a4)+,(a1)+
lea $9e(a1),a1
cmp.l d6,a1
blt.s t17a06
lea $ffff8308(a1),a1
cmp.l d4,a1
blt.s t17a06
lea $ffffff62(a1),a1
t17a06: dbf d0,t179ee
t17a0a: cmp.l d5,a5
blt.s t179be
moveq #1,d0
t_end: movem.l (sp)+,d1-d6/a2-a5
bra.s cont
t17a18: move.w d3,(a1)+
lea $9e(a1),a1
cmp.l d6,a1
blt.s t17a2e
lea $ffff8308(a1),a1
cmp.l d4,a1
blt.s t17a2e
lea $ffffff62(a1),a1
t17a2e: dbf d0,t17a18
cmp.l d5,a5
blt.s t179be
moveq #1,d0
movem.l (sp)+,d1-d6/a2-a5
rts
t_getpal: cmpi.b #2,(a0)+ ; Color mode?
ble.s t_color
addq.l #4,a0
t_color: moveq #31,d0 ; install palette
lea tinpal(pc),a2
t_copypal:move.b (a0)+,(a2)+
dbra d0,t_copypal
move.b (a0)+,d1
lsl.w #8,d1
move.b (a0)+,d1
addq.l #2,a0
movea.l a0,a5 ; beginning of Data
ext.l d1
adda.l d1,a0
movea.l a0,a4 ; end of Data
moveq #1,d0
rts
cont lea tinpal(pc),a0 ; pictures palette
lea $ffff8240.W,a1 ; ST palette
movem.l (a0),d0-d7 ; move from one
movem.l d0-d7,(a1) ; to the other
move.l $44e.w,a0 ; current screen address
lea buffer,a1 ; source
move.w #$1f3f,d0 ; (32000/4)-1 = $1F3F (7999)
bmove move.l (a1)+,(a0)+ ; move it
dbf d0,bmove ; loop
pea null(pc) ; command line
pea null(pc) ; environment
pea progfile(pc) ; filename
clr.w -(sp) ; load & execute
move.w #$4b,-(sp) ; p_exec
trap #1 ; do it !!
lea 16(sp),sp ; tidy stack
exit rts ; bye bye
null ds.l 0
filename dc.b '\source.tn1',0
progfile dc.b '\killclod.prg',0
ifne text_on
text dc.b $1B,'E'
dc.b $1b,89,44,35 ; Text at 12 down & 3 in !!
; 0123456789012345678901234567890123456789 - 40 chars
dc.b 'Virus Free Disk From The Source !!',0
endc
tinpal ds.w 16
handle ds.w 1
;
; Alter length of 'blanks' to ensure length of bootsector is equal
; to 480 bytes !!
;
ifne text_on
blanks ds.w 2 ; amount when text function is on
elseif
blanks ds.w 28 ; and when it's off
endc